package com.jiulan.hearthearing.ui.menus;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jiulan.hearthearing.R;

import java.util.List;

public class MenuAdapter extends BaseQuickAdapter<MenuModel, BaseViewHolder> {

    public MenuAdapter(List<MenuModel> data) {
        super(R.layout.item_menu, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MenuModel item) {
        helper.setText(R.id.tvName, item.getActiveName());
        ImageView ivIcon = helper.getView(R.id.ivIcon);
        ivIcon.setBackgroundResource(item.getActivePic());
    }
}
